<script>
import { showToast } from './hooks/utils'
import store from './store'
export default {
  onLaunch: function () {
    console.log('App Launch')
    uni.addInterceptor('request', {
      invoke(args) {
        args.url = 'https://tools-api.xiaoohui.com' + args.url;
        // if( args.data && !uni.getStorageSync('wpa_username') ){
        //   args.data.username = uni.getStorageSync('wpa_username')
        // }
      },
	  success(result) {
		  if(result.data.code){
			  showToast(result.data.message)
			  return Promise.reject(result.data)
		  }
	  },
	  fail(err) {
		  showToast('系统繁忙，请稍后再试')
	  }
    })
	store.getUserInfo()
  },
  onShow: function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  },
}
</script>

<style lang="scss">
@import '@/unistyle.scss';
/*每个页面公共css */
body{
  font-size: 1rem;
}
</style>
